import request from "@/utils/request.js";
/**
 * 获取推荐列表
 */ 
export function getshopList(){
	return request.get('shop/fineFood/goodList',{noAuth:true})
}
/**
 * 获取商品列表
 */ 
export function getProMore(page){
	return request.get('shop/fineFood/list?page='+page,{noAuth:true})
}
/**
 * 获取店铺列表
 */ 
export function getShopMore(page,type){
	return request.get('shop/restaurant/list?page='+page+'&type='+type,{noAuth:true})
}


/**
 * 获取商品详情
 */ 
export function getProDetail(id){
	return request.get(`shop/productInfo/${id}`,{noAuth:true})
}

/**
 * 获取门店详情
 */ 
export function getShopDetail(id,type){
	return request.get(`shop/info/${id}/${type}`,{noAuth:true})
}
/**
 * 获取预下单详情
 */ 
export function getOrderConfirm(productId){
	return request.get(`shop/order/preData/${productId}`,{noAuth:true})
}

/**
 * 创建订单
 */ 
export function gocreateOrder(obj){
	return request.post('shop/order/create',obj)
}

/**
 *  订单详情
 */ 
export function getOrderDetail(id){
	return request.get(`shop/order/info/${id}`)
}


/**
 *  订单支付
 */ 
export function goPaythisOrder(orderNo){
	return request.post(`shop/order/payment/${orderNo}`)
}
/**
 *  查询支付结果	
 */ 
export 	function queryPayResult(orderNo){
	return request.get(`shop/order/queryPayResult/${orderNo}`)
}

/**
 * 获取申请退款数据 
 */
export function getRefundData(id){
	return request.get(`shop/order/refundData/${id}`)
}
/**
 * 申请退款
 */ 
export function goRefundapply(refundRequest){
	return request.post('shop/order/refund',refundRequest)
}

 /**
  * 全部订单订单列表
  */ 
 
export function getOrderListDefault(page){
	return request.get('shop/order/list?page='+page)
}

/**
  * 取消订单
  */ 
export function cancelOrder(id){
	return request.post(`shop/order/del/${id}`)
}

 /**
  * 状态订单列表
  */ 
 
export function getOrderList(page,status){
	return request.get('shop/order/list?page='+page+'&status='+status)
}

/**
 * 根据核销码查询待核销信息
 */

export function getwriteoffInfo(code){
	return request.get(`shop/order/writeOffInfo/${code}`)
}

/**
 * 当前用户所属店铺的核销记录列表
 */ 

export function getwriteoffList(page){
	return request.get('shop/order/writeOffList?page='+page)
}
/**
 * 提交核销
 */ 

export function gowriteOff(code){
	return request.post(`shop/order/writeOff/${code}`)
}


/**
 * 获取休闲娱乐分类店铺列表
 */ 
export function getEtmList(){
	return request.get('shop/amusement/list',{noAuth:true})
}


/**
 * 点赞 取消点赞
 */

export function giveAndcancle(id){
	return request.post(`shop/give/${id}`)
}
